use crate::dao;
use crate::models::models::components::v2ray::router::ComponentV2rayRouter;
use crate::runtime::response::MagicBoxResponse;
use crate::runtime::result::MagicBoxResult;

#[tauri::command(rename_all = "snake_case")]
pub(crate) async fn invoke_component_v2ray_routers() -> MagicBoxResult<MagicBoxResponse<Vec<ComponentV2rayRouter>>> {
    let routers = dao::components::v2ray::router::get_all_routers()?;

    Ok(MagicBoxResponse::new_success(routers))
}